package com.xy.controller.calculate;

import com.xy.api.model.request.calculate.lirun.temu.LadderCostRequest;
import com.xy.api.model.request.calculate.lirun.temu.SaveLadderCostRequest;
import com.xy.api.model.response.R;
import com.xy.api.model.dto.calculate.LadderCostResultDTO;
import com.xy.api.service.calculate.ILadderCostService;
import com.xy.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ladderCost")
public class LadderCostController extends BaseController {

    @Autowired
    private ILadderCostService ladderCostService;

    @PostMapping("/list")
    public R queryLadderCostList(@RequestBody LadderCostRequest request) {
        LadderCostResultDTO result = ladderCostService.queryLadderCostList(request);
        return success(result);
    }

    @PostMapping("/save")
    public R saveLadderCost(@RequestBody SaveLadderCostRequest request){
        ladderCostService.saveLadderCost(request);
        return success();
    }
}
